const _0x337e = [
  "replace",
  "Unsupported\x20algorithm:\x20",
  "0xd",
  "123456",
  "0xe",
  "random",
  "padStart",
  "HS256",
  "exp",
  "map",
  "toString",
  "0xa",
  "importKey",
  "then",
  "0x5",
  "0x8",
  "JWT",
  "0x11",
  "0x9",
  "now",
  "0x4",
  "0x0",
];
const _0x5c1b = function (_0x337e42, _0x5c1b7e) {
  _0x337e42 = _0x337e42 - 0x0;
  let _0x385332 = _0x337e[_0x337e42];
  return _0x385332;
};
const _0x4564 = [
  "HMAC",
  "encode",
  "sign",
  _0x5c1b("0x10"),
  "now",
  "SHA-256",
  "toString",
  "subtle",
  "SHA-512",
  _0x5c1b("0x6"),
  "stringify",
  _0x5c1b("0xd"),
  _0x5c1b("0x8"),
  "floor",
  _0x5c1b("0x3"),
  _0x5c1b("0x0"),
  _0x5c1b("0xc"),
  _0x5c1b("0x7"),
];
const _0x379b = function (_0x432bdb, _0x5870c4) {
  _0x432bdb = _0x432bdb - 0x0;
  let _0x2766f4 = _0x4564[_0x432bdb];
  return _0x2766f4;
};
export function generateJWT(
  _0x3cd460,
  _0x226d5c,
  _0x41eef9 = _0x379b(_0x5c1b("0x4")),
  _0x2689b8 = _0x379b("0x11"),
  _0xdf35b8 = 0x3c
) {
  function _0x5b7d41(_0x10b6d9) {
    let _0x42bfb8 = btoa(_0x10b6d9);
    _0x42bfb8 = _0x42bfb8[_0x5c1b("0x0")](/\+/g, "-")[_0x379b("0xf")](
      /\//g,
      "_"
    );
    return _0x42bfb8[_0x5c1b("0x0")](/=+$/, "");
  }
  async function _0x3c8234(
    _0x2c56d3,
    _0x302000,
    _0x229196 = _0x379b(_0x5c1b("0x11"))
  ) {
    const _0x22bd0e = {
      HS256: _0x379b(_0x5c1b("0xe")),
      HS384: "SHA-384",
      HS512: _0x379b(_0x5c1b("0xf")),
    };
    if (!_0x22bd0e[_0x229196]) {
      throw new Error(_0x5c1b("0x1") + _0x229196);
    }
    const _0x48c00b = await crypto[_0x379b("0x7")][_0x379b("0x10")](
      "raw",
      new TextEncoder()["encode"](_0x302000),
      { name: _0x379b("0x0"), hash: { name: _0x22bd0e[_0x229196] } },
      ![],
      ["sign"]
    );
    const _0x314698 = await crypto["subtle"][_0x379b("0x2")](
      _0x379b(_0x5c1b("0x15")),
      _0x48c00b,
      new TextEncoder()[_0x379b("0x1")](_0x2c56d3)
    );
    return Array["from"](new Uint8Array(_0x314698))
      [_0x5c1b("0x9")]((_0xbffd7) =>
        _0xbffd7[_0x379b("0x6")](0x10)[_0x379b(_0x5c1b("0x12"))](0x2, "0")
      )
      ["join"]("");
  }
  const _0x1fd555 = {
    iss: _0x3cd460,
    iat:
      Math[_0x379b(_0x5c1b("0x2"))](Date[_0x379b(_0x5c1b("0x14"))]() / 0x3e8) -
      0x1e,
    exp:
      Math[_0x379b(_0x5c1b("0x2"))](Date[_0x5c1b("0x13")]() / 0x3e8) +
      _0xdf35b8,
    nbf: Math[_0x379b(_0x5c1b("0x2"))](Date[_0x379b("0x4")]() / 0x3e8) - 0x1e,
    sub: _0x226d5c,
    jti: Math[_0x5c1b("0x5")]()[_0x5c1b("0xa")](0x24)["substring"](0x2),
  };
  const _0x15edc8 = { alg: _0x2689b8, typ: _0x379b("0x3") };
  const _0x13614a = _0x5b7d41(JSON[_0x379b(_0x5c1b("0xb"))](_0x15edc8));
  const _0x544853 = _0x5b7d41(JSON["stringify"](_0x1fd555));
  return _0x3c8234(_0x13614a + "." + _0x544853, _0x41eef9, _0x2689b8)[
    _0x379b("0xb")
  ]((_0x4b9fee) => {
    const _0x2cd4ca = _0x13614a + "." + _0x544853 + "." + _0x4b9fee;
    return { token: _0x2cd4ca, expireTime: _0x1fd555[_0x379b("0xc")] };
  });
}
